package com.example.administrator.waitan.find.news.newscontent;

import android.content.Intent;
import android.os.Bundle;
import android.widget.ImageView;
import android.widget.TextView;

import com.android.volley.RequestQueue;
import com.android.volley.toolbox.ImageLoader;
import com.android.volley.toolbox.Volley;
import com.example.administrator.waitan.R;
import com.example.administrator.waitan.base.BaseActivity;
import com.example.administrator.waitan.tools.DoubleCache;
import com.example.administrator.waitan.tools.GsonRequest;

/**
 * Created by Administrator on 2016/1/22.
 */
public class NewsAuthorContentActivity extends BaseActivity {
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_news_author_content);
        RequestQueue queue = Volley.newRequestQueue(this);
        Intent intent = getIntent();
        String nickname,avatar_url,signature,profile;
        nickname = intent.getStringExtra("nickname");
        avatar_url = intent.getStringExtra("avatar_url");
        signature = intent.getStringExtra("signature");
        profile = intent.getStringExtra("profile");
        TextView tvName,tvSignature,tvProfile;
        ImageView ivAvatar;
        tvName = (TextView) findViewById(R.id.tv_news_author_content_name);
        tvName.setText(nickname);
        tvSignature = (TextView) findViewById(R.id.tv_news_author_content_singnature);
        tvSignature.setText(signature);
        tvProfile = (TextView) findViewById(R.id.tv_news_author_content_content);
        tvProfile.setText(profile);
        ivAvatar = (ImageView) findViewById(R.id.iv_news_author_content_head);
        ImageLoader.ImageListener listener = ImageLoader.getImageListener(ivAvatar,R.mipmap.mi_icon,R.mipmap.mi_icon);
        ImageLoader imageLoader = new ImageLoader(queue,new DoubleCache());
        imageLoader.get(avatar_url,listener);
    }
}
